<template>
	<view>
		<view class="smart-page-head">
			<view class="smart-page-head-title">input, 输入框</view>
		</view>

		<view class="smart-padding-wrap">
			<view class="item">可自动获取焦点的</view>
			<view>
				<input class="smart-input" focus="true" placeholder="自动获取焦点" />
			</view>

			<view class="item">输入内容：<text style="color: #007AFF;">{{ inputValue }}</text></view>
			<view>
				<input class="smart-input" @input="onKeyInput" placeholder="输入内容同步显示在上方" />
			</view>

			<view class="item">右下角显示搜索</view>
			<view>
				<input class="smart-input" confirm-type="search" placeholder="搜索" />
			</view>

			<view class="item">控制最大输入长度为</view>
			<view>
				<input class="smart-input" maxlength="10" placeholder="最大输入长度为" />
			</view>

			<view class="item">数字输入</view>
			<view>
				<input class="smart-input" password="true" type="number" placeholder="请输入数字" />
			</view>

			<view class="item">密码输入</view>
			<view>
				<input class="smart-input" password="true" type="text" placeholder="请输入密码" />
			</view>

			<view class="item">带小数点输入</view>
			<view>
				<input class="smart-input" type="digit" placeholder="这是一个带小数点输入框" />
			</view>

			<view class="item">身份证输入</view>
			<view>
				<input class="smart-input" type="idcard" placeholder="这是一个身份证输入框" />
			</view>



		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				inputValue: '',
				showPassword: true,
				inputValue: '',
				showClearIcon: false
			};
		},
		methods: {
			onKeyInput: function(event) {
				this.inputValue = event.detail.value;
			},
			clearInput: function(event) {
				this.clearInputValue = event.detail.value;
				if (event.detail.value.length > 0) this.showClearIcon = true;
				else this.showClearIcon = false;
			},
			clearIcon: function(event) {
				this.clearInputValue = '';
				this.showClearIcon = false;
			},
			changePassword: function() {
				this.showPassword = !this.showPassword;
			}
		}
	};
</script>

<style>
	.item {
		margin-bottom: 40px;
	}

	.uni-icon {
		font-family: uniicons;
		font-size: 24px;
		font-weight: normal;
		font-style: normal;
		width: 24px;
		height: 24px;
		line-height: 24px;
		color: #999999;
		margin-top: 5px;
	}

	.wrapper {
		/* #ifdef */
		display: flex;
		/* #endif */
		flex-direction: row;
		flex-wrap: nowrap;
		background-color: #d8d8d8;
	}

	.eye-active {
		color: #007aff;
	}
</style>